package win.smartown.android.library.certificateCamera.detection;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * @author xiongbin
 * @description:
 * @date : 2021/3/9 8:50
 */

public class ScanResult implements Parcelable {
    public static final  int SUCCESS=1;
    public static final  int FAILED=2;
    public int status; // 身份证照片的状态，模糊：-1，正常：0.
    public int isSucess; // 成功：0，失败：1
    public int isBackSucess; // 成功：0，失败：1
    public int action; //  可选动作
    public ArrayList<String> recognitions;

    //当前检测是第几帧
    public int currentactionindex=0;

    public String message;
    public Bitmap bitmap;
    public boolean isStart = false;
    public int isStartNum;
    public boolean pictureLocation = false;  //人脸照片在手机屏幕里面的相对位置
    public boolean startRecognizeNow;



    public float boxleft=0;
    public float boxright=0;
    public float boxtop=0;
    public float boxbottom=0;
    public float faceboxheight=0;
    public float faceboxwidth=0;

    //五点
    public float left_eye_x=0;
    public float left_eye_y=0;
    public float right_eye_x=0;
    public float right_eye_y=0;
    public float nose_x=0;
    public float nose_y=0;
    public  float left_mouse_x=0;
    public  float left_mouse_y=0;
    public  float right_mouse_x=0;
    public  float right_mouse_y=0;

    public Object top;
    
    
    
    public int ScreenWidth;
    public int ScreenHeight;
    public byte[] bytes;

    protected ScanResult(Parcel in) {
        status = in.readInt();
        isSucess = in.readInt();
        message = in.readString();
        bitmap = in.readParcelable(Bitmap.class.getClassLoader());
    }

    public ScanResult(int code, String message) {
        this.status = code;
        this.message = message;
    }

    public ScanResult() {
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(status);
        dest.writeInt(isSucess);
        dest.writeString(message);
        dest.writeParcelable(bitmap, flags);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ScanResult> CREATOR = new Creator<ScanResult>() {
        @Override
        public ScanResult createFromParcel(Parcel in) {
            return new ScanResult(in);
        }

        @Override
        public ScanResult[] newArray(int size) {
            return new ScanResult[size];
        }
    };
}
